#include("../layout.html")
#@layout("文章")

#define body()
<h1 class="wp-heading-inline">文章</h1>
<a href="/admin/post/create" class="page-title-action">写文章</a>
<hr class="wp-header-end">

<div class="layui-fluid">
	<h2 class="screen-reader-text">过滤文章列表</h2>
	<ul class="subsubsub">
		<li class="all"><a href="/admin/post" class="current" aria-current="page">全部<span class="count">（#(all)）</span></a> |</li>
		<li class="publish"><a href="/admin/post?post_status=publish">已发布<span class="count">（#(publish)）</span></a> |</li>
		<li class="sticky"><a href="/admin/post?show_sticky=1">置顶<span class="count">（#(sticky)）</span></a> |</li>
		<li class="draft"><a href="/admin/post?post_status=draft">草稿<span class="count">（#(draft)）</span></a> |</li>
		<li class="pending"><a href="/admin/post?post_status=pending">待审<span class="count">（#(pending)）</span></a> |</li>
		<li class="trash"><a href="/admin/post?post_status=trash">回收站<span class="count">（#(trash)）</span></a></li>
	</ul>
	
	<form id="posts-filter" class="layui-form">
		<div class="search-box">
			<label class="screen-reader-text" for="post-search-input">搜索文章:</label>
			<div class="layui-inline">
				<input type="search" id="post-search-input" name="s" value="" class="layui-input">
			</div>
			<div class="layui-inline">
				<input type="submit" id="search-submit" class="layui-btn layui-btn-sm layui-btn-primary" value="搜索文章">
			</div>
		</div>
		<div class="tablenav top">
			<div class="alignleft actions bulkactions">
				<label for="bulk-action-selector-top" class="screen-reader-text">选择批量操作</label>
				<div class="layui-inline">
					<select name="action" id="bulk-action-selector-top">
						<option value="-1">批量操作</option>
						<option value="edit">编辑</option>
						<option value="trash">移至回收站</option>
						<option value="untrash">还原</option>
						<option value="delete">永久删除</option>
					</select>
				</div>
				<div class="layui-inline">
					<input type="submit" id="doaction" class="layui-btn layui-btn-sm layui-btn-primary" value="应用">
				</div>
			</div>
			<div class="alignleft actions">
				<label for="filter-by-date" class="screen-reader-text">按日期筛选</label>
				<div class="layui-inline">
					<select name="m" id="filter-by-date">
						<option selected="selected" value="0">全部日期</option>
						<option value="201903">2019年三月</option>
						<option value="201804">2018年四月</option>
					</select>
				</div>
				<label class="screen-reader-text" for="cat">按分类过滤</label>
				<div class="layui-inline">
					<select name="cat" id="cat" class="postform">
						<option value="0">所有分类目录</option>
						<option class="level-0" value="1">未分类</option>
					</select>
				</div>
				<div class="layui-inline">
					<input type="submit" name="filter_action" id="post-query-submit" class="layui-btn layui-btn-sm layui-btn-primary" value="筛选">	
				</div>
				<div class="layui-inline">
					<input type="submit" name="filter_action" id="post-query-submit" class="layui-btn layui-btn-sm layui-btn-primary" value="清空回收站">	
				</div>
			</div>
			<div class="tablenav-pages"></div>
			<br class="layui-clear">
		</div>
		
		<h2 class="screen-reader-text">文章列表</h2>
		<table class="layui-table" lay-skin="line" lay-even>
		  	<colgroup>
		  		<col width="30">
		    	<col>
		    	<col width="120">
		    	<col width="180">
		    	<col width="180">
		    	<col width="60">
		    	<col width="150">
		  	</colgroup>
		  	<thead>
		    	<tr align="left">
		    		<th><input type="checkbox" name="" lay-skin="primary"></th>
		      		<th>标题</th>
		      		<th>作者</th>
		      		<th>分类目录</th>
		      		<th>标签</th>
		      		<th><i class="layui-icon layui-icon-chat"></i></th>
		      		<th>日期</th>
		    	</tr> 
		  	</thead>
		  	<tbody>
		    	
		  	</tbody>
		  	#[[
		  		<script id="post-page-tpl" type="text/xml">
				{{# layui.each(d, function(index, item){ }}
				<tr align="left">
		    		<td><input type="checkbox" name="" lay-skin="primary"></td>
		      		<td>
		      			<strong>
							<a href="/admin/post/edit?post={{item.ID}}">{{item.post_title}}</a>
							{{# if(item.sticky){ }}
							—
							<span class="post-state">置顶</span>
							{{# } }}
						</strong>
		      			<div class="row-actions">
		      				<span class="edit"><a href="/admin/post/edit?post={{item.ID}}" aria-label="编辑“(无标题)”">编辑</a> | </span>
		      				<span class="trash"><a href="javascript:;" onclick="layui.post.trash({{item.ID}})" aria-label="移动“(无标题)”到垃圾箱">移至回收站</a> | </span>
		      				<span class="view"><a href="" rel="bookmark" aria-label="预览“(无标题)”">预览</a></span>
		      			</div>
		      		</td>
		      		<td>
		      			<a href="/admin/post?author={{item.author.ID}}">{{item.author.display_name}}</a>
		      		</td>
		      		<td>
						{{# if(0 == item.categories.length){ }}
						<span>—</span>
		      			<span class="screen-reader-text">没有分类</span>
						{{# }else{ }}
						{{# layui.each(item.categories, function(i, e){ }}
		      			<a href="/admin/post?category_name={{e.slug}}">{{e.name}}</a>
						{{# if(i < item.categories.length - 1){ }}、{{# } }}
						{{# }); }}
						{{# } }}
		      		</td>
		      		<td>
						{{# if(0 == item.tags.length){ }}
						<span>—</span>
		      			<span class="screen-reader-text">没有标签</span>
						{{# }else{ }}
		      			{{# layui.each(item.tags, function(i, e){ }}
		      			<a href="/admin/post?tag_name={{e.slug}}">{{e.name}}</a>
						{{# if(i < item.tags.length - 1){ }}、{{# } }}
						{{# }); }}
						{{# } }}
					</td>
		      		<td>
						{{# if(0 == item.comments){ }}
		      			<span>—</span>
		      			<span class="screen-reader-text">无评论</span>
						{{# }else{ }}
						<a href="/admin/comment?post={{item.ID}}">{{item.comments}}</a>
						{{# } }}
		      		</td>
		      		<td>
		      			最后修改
		      			<br/>
		      			<abbr title="{{item.post_modified_gmt}}">{{item.post_modified_format}}</abbr>
		      		</td>
		    	</tr>
				{{# }); }}
				</script>
		  	]]#
		  	<tfoot>
		    	<tr align="left">
		    		<th><input type="checkbox" name="" lay-skin="primary"></th>
		      		<th>标题</th>
		      		<th>作者</th>
		      		<th>分类目录</th>
		      		<th>标签</th>
		      		<th><i class="layui-icon layui-icon-chat"></i></th>
		      		<th>日期</th>
		    	</tr> 
		  	</tfoot>
		</table>
		
		<div class="tablenav bottom">
			<div class="alignleft actions bulkactions">
				<label for="bulk-action-selector-bottom" class="screen-reader-text">选择批量操作</label>
				<div class="layui-inline">
					<select name="action2" id="bulk-action-selector-bottom">
						<option value="-1">批量操作</option>
						<option value="edit">编辑</option>
						<option value="trash">移至回收站</option>
						<option value="untrash">还原</option>
						<option value="delete">永久删除</option>
					</select>
				</div>
				<div class="layui-inline">
					<input type="submit" id="doaction2" class="layui-btn layui-btn-sm layui-btn-primary" value="应用">
				</div>
			</div>
			<div class="alignleft actions">
				<div class="layui-inline">
					<input type="submit" name="filter_action" id="post-query-submit" class="layui-btn layui-btn-sm layui-btn-primary" value="清空回收站">	
				</div>
			</div>
			<div class="tablenav-pages"></div>
			<br class="layui-clear">
		</div>
	</form>
</div>
#end

#define foot()
<script>
layui.cache.page = 'post';
</script>
#end